(* --------------------------------------------------------------------------
  :Program.       ums
  :Contents.      Interfaces for ums.library
  :Author.        Martin Koyro [mk]
  :Address.       SnailMail:                EMail:
  :Address.       Salzmannstr. 12           MAUS: MS3
  :Address.       48147 Muenster            INET: mk@ms3.ms.open.de
  :Address.       GERMANY
  :Author.        Martin Loos [ml]
  :Address.       SnailMail:                EMail:
  :Address.       Im Scheidt 25             MAUS: UN
  :Address.       58640 Iserlohn-Kalthof    INET: mattin@unicorn.mk.open.de
  :Address.       GERMANY                   FIDO: 2:243/4624.2 (GCC)
  :History.       [mk] 19-Jan-93: Conversion from Oberon to Modula-2
  :Language.      Modula II
  :Translator.    M2Amiga V4.1.07d
-------------------------------------------------------------------------- *)
DEFINITION MODULE UmsL{"ums.library",9};


IMPORT d:UmsD,e:ExecD,R,u:UtilityD,s:SYSTEM;

CONST
  umsMinVersion=9;
  umsName="ums.library";

VAR
  umsVersion:INTEGER;
  umsBase:e.LibraryPtr;

  (***  functions ***)

PROCEDURE Login( user{R.D2}   : d.STRPTR;
                 passwd{R.D3} : d.STRPTR): LONGINT; CODE -30;


PROCEDURE Logout( account{R.D2} : LONGINT);  CODE -36;

PROCEDURE PutUMSMsg( account{R.D2}: LONGINT;
                     Msg{R.D3}    : d.oldMsgPtr): INTEGER; CODE -42;

PROCEDURE GetMsgHdr( account{R.D2}: LONGINT;
                     MsgNum{R.D3} : INTEGER): d.oldMsgPtr; CODE -48;

PROCEDURE GetMsgTxt( account{R.D2} : LONGINT;
                     Msg{R.D3}     : d.oldMsgPtr): INTEGER; CODE -54;

PROCEDURE FreeMsg( account{R.D2}: LONGINT;
                   Msg{R.D3}    : d.oldMsgPtr);  CODE -60;


PROCEDURE NextNew( account{R.D2}: LONGINT;
                   MsgNum{R.D3} : INTEGER): INTEGER; CODE -66;

PROCEDURE SearchID( account{R.D2}: LONGINT;
                    id{R.D3}     : d.STRPTR): INTEGER;  CODE -72;

PROCEDURE ChangeID( account{R.D2}: LONGINT;
                    MsgNum{R.D3} : INTEGER;
                    id{R.D4}     : d.STRPTR): BOOLEAN;  CODE -78;

PROCEDURE ChainUp( account{R.D2}: LONGINT;
                   MsgNum{R.D3} : INTEGER): INTEGER;  CODE -84;

PROCEDURE ChainDn( account{R.D2}: LONGINT;
                   MsgNum{R.D3} : INTEGER): INTEGER; CODE -90;

PROCEDURE ChainRt( account{R.D2}: LONGINT;
                   MsgNum{R.D3} : INTEGER): INTEGER; CODE -96;

PROCEDURE ChainLt( account{R.D2}: LONGINT;
                   MsgNum{R.D3} : INTEGER): INTEGER;  CODE -102;

PROCEDURE GetGlobal( account{R.D2}: LONGINT;
                     name{R.D3}   : d.STRPTR;
                     data{R.D4}   : d.STRPTR);  CODE -108;

PROCEDURE DumpConfig( account{R.D2}: LONGINT) ;  CODE -114;

PROCEDURE ErrNum( account{R.D2}: LONGINT): INTEGER; CODE -120;

PROCEDURE ErrTxt( account{R.D2}: LONGINT): d.STRPTR; CODE -126;

PROCEDURE DeleteMsg( account{R.D2}: LONGINT;
                     MsgNum{R.D3} : INTEGER): BOOLEAN; CODE -132;

PROCEDURE ChangeAttributes( account{R.D2}: LONGINT;
                            MsgNum{R.D3} : INTEGER;
                            att{R.D4}    : d.STRPTR): BOOLEAN; CODE -138;

PROCEDURE NextStatus( account{R.D2}: LONGINT;
                      from{R.D3}   : INTEGER;
                      mask{R.D4}   : s.BITSET;
                      status{R.D5} : s.BITSET): INTEGER; CODE -144;

(*** definetly obsolete

PROCEDURE SelectStatus( account{R.D2}: LONGINT;
                        set{R.D3}    : s.BITSET;
                        mask{R.D4}   : s.BITSET;
                        status{R.D5} : s.BITSET): INTEGER;  CODE -150;

PROCEDURE SelectGroup( account{R.D2}: LONGINT;
                       set{R.D3}    : s.BITSET;
                       group{R.D4}  : d.STRPTR): INTEGER; CODE -156;
***)

PROCEDURE SetStatus( acc{R.D2}    : LONGINT;
                     MsgNum{R.D3} : INTEGER;
                     unset{R.D4}  : s.BITSET;
                     set{R.D5}    : s.BITSET);  CODE -162;

PROCEDURE PrevStatus( acc{R.D2}    : LONGINT;
                      from{R.D3}   : INTEGER;
                      mask{R.D4}   : s.BITSET;
                      status{R.D5} : s.BITSET): INTEGER;  CODE -168;

PROCEDURE SelStatus( acc{R.D2}    : LONGINT;
                     set{R.D3}    : s.BITSET;
                     unset{R.D4}  : s.BITSET;
                     mask{R.D5}   : s.BITSET;
                     status{R.D6} : s.BITSET): INTEGER;  CODE -174;

PROCEDURE SelGroup( acc{R.D2}    : LONGINT;
                    set{R.D3}    : s.BITSET;
                    unset{R.D4}  : s.BITSET;
                    group{R.D5}  : d.STRPTR): INTEGER;  CODE -180;

PROCEDURE GetStatus( acc{R.D2}    : LONGINT;
                     MsgNum{R.D3} : LONGINT): s.BITSET; CODE -186;

PROCEDURE FlushUMS(); CODE -192;

PROCEDURE CleanMB(): INTEGER;  CODE -198;

PROCEDURE QuitUMS();  CODE -204;


(*** V8: ***)

PROCEDURE UMSARexxQuery(); CODE -210;

(*** V9: ***)

(*** Patterns removed 6.10.92

PROCEDURE AllocUMSPattern( pattern{R.D2}: d.STRPTR;
                           case{R.D3}  : BOOLEAN): s.ADDRESS;  CODE -216;

PROCEDURE FreeUMSPattern( pHandle{R.D2}: s.ADDRESS );  CODE -222;

PROCEDURE MatchUMSPattern( pHandle{R.D2}: s.ADDRESS;
                           string{R.D3} : d.STRPTR): BOOLEAN; CODE -228;
***)

PROCEDURE ExportedMsg( acc{R.D2}    : LONGINT;
                       num{R.D3}    : LONGINT);  CODE -234;

PROCEDURE CannotExport( acc{R.D2}    : LONGINT;
                        num{R.D3}    : LONGINT;
                        error{R.D4}  : d.STRPTR): BOOLEAN; CODE -240;


PROCEDURE LogUMS( acc{R.D2}    : LONGINT;
                  level{R.D4}  : LONGINT;
                  format{R.D5} : d.STRPTR;
                  args{R.D6}   : s.ADDRESS);  CODE -246;


PROCEDURE LogUms( acc{R.D2}    : LONGINT;
                  level{R.D4}  : LONGINT;
                  format{R.D5} : d.STRPTR;
                  args{R.D6}   : LONGINT);   CODE -246;

PROCEDURE UMSRLogin( server{R.D2} : d.STRPTR;
                     user{R.D3}   : d.STRPTR;
                     passwd{R.D4} : d.STRPTR): LONGINT;  CODE -252;


PROCEDURE WriteUMSMsg( acc{R.D2}    : LONGINT;
                       tagItems{R.D3}: u.TagItemPtr): LONGINT; CODE -258;

PROCEDURE ReadUMSMsg( acc{R.D2}    : LONGINT;
                      tagItems{R.D3}: u.TagItemPtr): BOOLEAN; CODE -264;

PROCEDURE FreeUMSMsg( acc{R.D2}    : LONGINT;
                      msgNum{R.D3} : LONGINT);  CODE -270;

PROCEDURE UMSSelect( acc{R.D2}     : LONGINT;
                     tagItems{R.D3}: u.TagItemPtr): LONGINT; CODE -276;

PROCEDURE UMSSearch( acc{R.D2}     : LONGINT;
                     tagItems{R.D3}: u.TagItemPtr): LONGINT; CODE -282;

PROCEDURE ReadUMSConfig( acc{R.D2}: LONGINT;
                         tagItems{R.D3}: u.TagItemPtr): d.STRPTR; CODE -288;

PROCEDURE FreeUMSConfig( acc{R.D2}    : LONGINT;
                         str{R.D3}    : d.STRPTR); CODE -294;


PROCEDURE WriteUMSConfig( acc{R.D2}: LONGINT;
                          tagItems{R.D3}: u.TagItemPtr): BOOLEAN; CODE -300;

PROCEDURE PrivateServerCall( command{R.D2}: LONGINT;
                             arg{R.D3}    : s.ADDRESS): LONGINT; CODE -306;

END UmsL.lib9
